package com.zqh.app.manager.impl;

import com.zqh.app.dao.CommentMapper;
import com.zqh.app.entity.SungoComment;
import com.zqh.app.manager.CommentManager;
import com.zqh.common.entity.Page;
import com.zqh.common.entity.Query;
import com.zqh.common.entity.R;
import com.zqh.common.utils.CommonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("commentManager")
public class CommentManagerImpl implements CommentManager {

    @Autowired
    CommentMapper commentMapper;
    @Override
    public List<SungoComment> getComments(Page<SungoComment> page, Query form) {
        return commentMapper.listForPage(page,form);
    }

    @Override
    public R reviewComments(Query form) {
        int count =  commentMapper.update(form);
        return CommonUtils.msg(count);
    }
}
